//auto gen by paipai.java.augogen ver 154
//author floatman
#ifndef _ACACCOUNTAO_ACACCOUNT_H_
#define _ACACCOUNTAO_ACACCOUNT_H_

#include <stdint.h>
#include <string>
#include <iostream>
#include "app_platform/help_macros.h"
#include "app_platform/intf_service.h"
#include "intf_acaccountao.h"

#include "library/basic/singleton_t.h"
#include "library/basic/sync_lock.h"
#include "c2cent/library/log/CWTimeElf3.h"

#include <map>
#include <set>
#include "erp/acaccount/po/bankaccountpo_acaccount.h"
#include "erp/acaccount/po/bankaccountfilterpo_acaccount.h"

HEADER_SELF_DEFINE_START
/**
 *  请在这里增加自定义包含的头文件，否则无法合并代码
 **/
#include "erp/acaccount/po/bankaccountpo_acaccount.h"
#include "erp/acaccount/po/bankaccountfilterpo_acaccount.h"
#include "c2cent/library/log/CWTimeElf3.h"
#include "erp/acaccount/dao/acaccountdao_stub4app_allinone.h"

using namespace erp::acaccount::po;
using namespace c2cent::library::wtimeelf;
HEADER_SELF_DEFINE_END


namespace erp
{
namespace acaccount
{
namespace ao
{

#define ACACCOUNTAO_SERVICE_VERSION "ERP_ACACCOUNT_AO___ACACCOUNTAO__SERVICE_VERSION__1.0 2013-10-31 18:45:19"
const std::string ACACCOUNTAO_SERVICE_NOUSE = ACACCOUNTAO_SERVICE_VERSION;

SERVICE class CACAccountAo : public IACAccountAo{
public:
		CACAccountAo(enum DeployMethod method = DEPLOY_STANDALONE);
		~CACAccountAo();
		 void Reset();
		static int Initialize(IUserDefineCntl* pCntl = NULL);

public:
	 /**
	 *
	 *    通过SysNos获取银行账户信息
	 *
	 */
	EXPORT(0xc0601801) uint32_t GetBankAccountBySysNos(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 const std::set<uint64_t> & setSysNoList,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::map<uint64_t,erp::acaccount::po::CBankAccountPo> & mapBankAccount,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    获取银行账户信息
	 *
	 */
	EXPORT(0xc0601802) uint32_t GetBankAccountByFilter(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 const erp::acaccount::po::CBankAccountFilterPo& oBankAccountFilter,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::vector<erp::acaccount::po::CBankAccountPo> & vecBankAccount,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    写入银行账户信息
	 *
	 */
	EXPORT(0xc0601803) uint32_t AddAndUpdateBankAccount(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 const erp::acaccount::po::CBankAccountPo& oBankAccount,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 uint64_t& ddwBankAccountSysNo,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    逻辑删除银行账户信息
	 *
	 */
	EXPORT(0xc0601804) uint32_t DeleteBankAccount(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint64_t ddwBankAccountSysNo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    写入&更新经营类会计项目信息
	 *
	 */
	EXPORT(0xc0601805) uint32_t AddAndUpdateACItems(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 const erp::acaccount::po::CACItemsPo& oACItemsPo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 uint64_t& ddwACItemsSysNo,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    逻辑删除经营类会计项目信息
	 *
	 */
	EXPORT(0xc0601806) uint32_t DeleteACItems(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint64_t ddwACItemsSysNo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    通过SysNos获取经营类会计项目信息
	 *
	 */
	EXPORT(0xc0601807) uint32_t GetACItemsBySysNos(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 const std::set<uint64_t> & setSysNoList,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::map<uint64_t,erp::acaccount::po::CACItemsPo> & mapAACItems,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *    Filter过滤获取经营类会计项目信息
	 *
	 */
	EXPORT(0xc0601808) uint32_t GetACItemsByFilter(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 const erp::acaccount::po::CACItemsFilterPo& oBankAccountFilter,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::vector<erp::acaccount::po::CACItemsPo> & vecACItems,
		 std::string& strOutReserve
		);

SECTION_SELF_DEFINE_START
/**
* 请在这里增加自定义的成员变量和函数，否则无法合并代码
**/
private:
	int32_t CheckCommPara(); //检查通用必填字段是否正确
	int32_t CheckBankAccountFilter(
			const erp::acaccount::po::CBankAccountFilterPo& oBankAccountFilter);
	int32_t CheckBankAccountPo(erp::acaccount::po::CBankAccountPo poBankAccount);//检查新增修改方法的银行账户PO字段是否正确

private:
	std::string m_strMachineKey; //机器码
	std::string m_strSource; //调用来源
	uint32_t m_dwSceneId; //场景id
	uint32_t m_dwOperatorUin; //约定为Table的序号ID

	static uint32_t s_dwPageSizeLimit; //分页大小
	erp::acaccount::dao::CACAccountDaoStub4App m_cACAccountDaoStub4App;
	static CItilGroup s_oGetBankAccountFilter; //银行账户查询ITIL上报对象
	static CItilGroup s_oGetBankAccountByIds; //银行账户ByIds查询ITIL上报对象
	static CItilGroup s_oAddAndUpdateBankAccount; //新增更新银行账户信息ITIL上报对象
	static CItilGroup s_oDeleteBankAccount; //逻辑删除银行账户信息ITIL上报对象
SECTION_SELF_DEFINE_END

private:
	enum DeployMethod m_method;
};

}
}
}

#endif /* _ACACCOUNTAO_ACACCOUNT_H_ */
